<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8">
<title>药品管理-编辑</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" href="${pageContext.request.contextPath}/back/css/x-admin.css" media="all">
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>

<script type="text/javascript">
	 $(function() {
		$("#updMedicine").click(function() {
			$.ajax({
				url : "${pageContext.request.contextPath}/updMedicine",
				type : "PUT", //修改操作  put方法
				contentType : "application/json",
				data : JSON.stringify({
					medicineid: $("#medicineid").val(),
					medicinename: $("#medicinename").val(),
					medicinetype: $("#medicinetype").val(),
					medicinenum : $("#medicinenum").val(),
					medicineprice :$("#medicineprice").val(),
				}),
				success : function(result) {
					if(result=="success"){
						/* window.location.close(); */
						location.href="${pageContext.request.contextPath}/medicine"
					}
				}
			});
		});
	}); 
</script>

</head>

<body>
	<div class="x-body">
		<form class="layui-form">
			<div class="layui-form-item">
				<div class="layui-input-inline">
					<input type="hidden" id="medicineid" class="layui-input" value="${medicine.medicineid}">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label"> 药品名称 </label>
				<div class="layui-input-inline">
					<input type="text" id="medicinename" class="layui-input" readonly="readonly" value="${medicine.medicinename}">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label"> 药品类型 </label>
				<div class="layui-input-inline">
					<input type="text" id="medicinetype" class="layui-input" readonly="readonly" value="${medicine.medicinetype}">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label"> 药品数量 </label>
				<div class="layui-input-inline">
					<input type="text" id="medicinenum" class="layui-input" value="${medicine.medicinenum}">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label"> 药品价格 </label>
				<div class="layui-input-inline">
					<input type="text" id="medicineprice" class="layui-input" value="${medicine.medicineprice}" required="required">
				</div>
			</div>
			<div class="layui-form-item">
				<label for="L_sign" class="layui-form-label"> </label>
				<input type="button" class="layui-btn" id="updMedicine" value="提交">
			</div>
		</form>
	</div>
	<script src="${pageContext.request.contextPath}/back/lib/layui/layui.js" charset="utf-8">
		
	</script>
	<script src="${pageContext.request.contextPath}/back/js/x-layui.js" charset="utf-8">
		
	</script>
	<script>
		layui.use([ 'form', 'layer' ], function() {
			$ = layui.jquery;
			var form = layui.form(), layer = layui.layer;

		});
	</script>
</body>

</html>